package org.bright.controller;

import org.apache.ibatis.annotations.Param;
import org.bright.entity.R;
import org.bright.service.IInventoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;

import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;

/**
 * <p>
 * 库存表 前端控制器
 * </p>
 *
 * @author bright
 * @since 2024-10-21
 */
@RestController
@RequestMapping("/inventory")
@CrossOrigin
public class InventoryController {
    @Autowired
    private IInventoryService inventoryService;
    @GetMapping("/selectAllInventory")
    public R selectAllInventory(@RequestParam("pageNum") int pageNum,@RequestParam("productName") String productName) throws UnsupportedEncodingException, NoSuchAlgorithmException, InvalidKeyException {
       return R.success(inventoryService.selectAllInventory(pageNum,productName));
    }
}
